package com.appspot.etao;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.*;

import com.appspot.etao.model.TaobaokeItemModel;
import com.appspot.etao.service.CronService;
import com.taobao.top.request.TaobaokeItemsGetRequest;

@SuppressWarnings("serial")
public class ETaoServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("Hello, world");
		
		CronService service = new CronService();
		
		System.out.println("begin...");
		
		TaobaokeItemsGetRequest request = new TaobaokeItemsGetRequest();
		request.setFields(Constant.FIELDS_TAOBAOKEITEM);
		request.setNick(Constant.NICK);
//		request.setCid("1055");
		request.setKeyword("女");
		request.setOrderBy("credit_desc");
		
//		service.getTopData(request);
		
		System.out.println("debug-1");
		
		service.removeLocalData();
		
		System.out.println("end...");

	}
}
